package lego.jbv;

public class CarControl {
	private int speedForward[] = {70, 70};
	private int speedBackward[] = {-70, -70};
	private int speedLeft[] = {60, 80};
	private int speedRight[] = {80, 60};
	private int speedLeftUTurn[] = {60, 70};
	private int speedRightUTurn[] = {70, 60};
	
	
	public void perform(CarCommand.Command command)
	{
		switch (command) {
		case FORWARD:
			Car.drive(speedForward[0], speedForward[1]);
			break;
			
		case BACKWARD:
			Car.drive(speedBackward[0], speedBackward[1]);
			break;
			
		case STOP:
			Car.stop();
			break;
			
		case LEFT:
			Car.drive(speedLeft[0], speedLeft[1]);
			break;
			
		case RIGHT:
			Car.drive(speedRight[0], speedRight[1]);
			break;
			
		case LEFT_UTURN:
			Car.drive(speedLeftUTurn[0], speedLeftUTurn[1]);
			break;
			
		case RIGHT_UTURN:
			Car.drive(speedRightUTurn[0], speedRightUTurn[1]);
			break;

		default:
			break;
		}
	}
}
